package com.southwind.mapper;

import com.southwind.entity.Bike;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.southwind.vo.BarVO;
import com.southwind.vo.BikeVO;
import com.southwind.vo.PieVO;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author admin
 * @since 2024-04-28
 */
public interface BikeMapper extends BaseMapper<Bike> {

    @Select({"select a.area,count(*) count from area a,bike b where a.id = b.aid group by a.id"})
    public List<BarVO> barVO();

    @Select({"select sum(time) value,b.number name from operate o,bike b where o.bid = b.id group by bid"})
    public List<PieVO> pieVO();

    @Select({"select number from bike where id = #{id} "})
    public String getNumberById(Integer id);

}
